/* =============================================
   Docker & Nginx 配置编辑器 - 样式表
   包含深色/浅色主题切换和响应式设计
   ============================================= */

:root {
    /* 颜色变量 */
    --primary-color: #2496ed;
    --secondary-color: #3bb4c1;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    
    /* 深色主题变量 */
    --dark-bg: #1e1e1e;
    --dark-secondary: #2d2d2d;
    --dark-tertiary: #3d3d3d;
    --dark-text: #e6e6e6;
    --dark-border: #444;
    
    /* 浅色主题变量 */
    --light-bg: #f8f9fa;
    --light-secondary: #e9ecef;
    --light-tertiary: #dee2e6;
    --light-text: #212529;
    --light-border: #ced4da;
    
    /* 通用变量 */
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* 深色主题 */
.dark-mode {
    --bg-color: var(--dark-bg);
    --secondary-bg: var(--dark-secondary);
    --tertiary-bg: var(--dark-tertiary);
    --text-color: var(--dark-text);
    --border-color: var(--dark-border);
    --input-bg: var(--dark-secondary);
    --input-border: var(--dark-border);
    --btn-primary-bg: var(--primary-color);
    --btn-primary-text: #fff;
    --btn-secondary-bg: var(--dark-tertiary);
    --btn-secondary-text: var(--dark-text);
}

/* 浅色主题 */
.light-mode {
    --bg-color: var(--light-bg);
    --secondary-bg: var(--light-secondary);
    --tertiary-bg: var(--light-tertiary);
    --text-color: var(--light-text);
    --border-color: var(--light-border);
    --input-bg: #fff;
    --input-border: var(--light-border);
    --btn-primary-bg: var(--primary-color);
    --btn-primary-text: #fff;
    --btn-secondary-bg: var(--light-tertiary);
    --btn-secondary-text: var(--light-text);
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
    background-image: linear-gradient(to bottom right, var(--secondary-bg), var(--bg-color));
    background-attachment: fixed;
}

/* 布局容器 */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* 页眉样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--secondary-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    position: relative;
}

.header-top {
    position: relative;
    margin-bottom: 15px;
}

.header-controls {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 15px;
}

.wallpaper-controls, .theme-toggle {
    display: flex;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.description {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主内容区域 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

/* 视图标签页 */
.view-tabs {
    display: flex;
    background-color: var(--secondary-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.view-tab {
    padding: 15px 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    flex: 1;
    text-align: center;
}

.view-tab.active {
    background-color: var(--primary-color);
    color: white;
}

.view-tab:hover:not(.active) {
    background-color: var(--tertiary-bg);
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* 编辑器视图 */
.editor-view {
    display: none;
    gap: 20px;
    grid-template-columns: 250px 1fr 250px;
    background-color: var(--secondary-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    min-height: 600px;
}

.editor-view.active {
    display: grid;
}

/* 侧边栏样式 */
.templates-sidebar, .parameters-sidebar {
    background-color: var(--tertiary-bg);
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
    max-height: 600px;
}

.templates-sidebar h2, .parameters-sidebar h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-color);
}

.template-category, .parameter-group {
    margin-bottom: 20px;
}

.template-category h3, .parameter-group h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

/* 按钮样式 */
.template-btn, .param-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: left;
    font-size: 0.9rem;
    transform-origin: center;
}

.template-btn:hover, .param-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(0.97);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 编辑器容器 */
.editor-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.editor-header {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    padding: 10px;
    display: flex;
    gap: 8px;
}

.btn-editor-action {
    padding: 6px 12px;
    background-color: var(--secondary-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 70px;
    justify-content: center;
}

.btn-editor-action:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(0.95);
}

/* 代码编辑器样式 */
.CodeMirror {
    height: 550px;
    font-size: 14px;
    border-radius: 8px;
    padding-top: 40px;
}

.CodeMirror-gutters {
    background-color: var(--tertiary-bg) !important;
    border-right: 1px solid var(--border-color) !important;
}

.CodeMirror-focused {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 参数项样式 */
.param-item {
    margin-bottom: 10px;
}

.param-item label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.param-item input[type="text"],
.param-item select {
    width: 100%;
    padding: 8px;
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    transition: var(--transition);
}

.param-item input[type="checkbox"] {
    margin-right: 8px;
}

/* 通用按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    margin-top: 5px;
    width: 100%;
}

.btn-primary {
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* 模板预览样式 */
.template-preview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--secondary-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
}

.template-preview.active {
    display: block;
}

.template-preview h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.template-preview pre {
    background-color: var(--tertiary-bg);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
    max-height: 50vh;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 20px;
    background-color: var(--secondary-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* 参数代码样式 */
.step-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.param-code {
    font-family: monospace;
    font-size: 0.85rem;
    margin: 5px 0;
    padding: 5px;
    background-color: var(--secondary-bg);
    border-radius: 3px;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background-color: var(--success-color);
    color: white;
    border-radius: 5px;
    box-shadow: var(--shadow);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background-color: var(--danger-color);
}

.notification.warning {
    background-color: var(--warning-color);
    color: var(--dark-text);
}

/* 图标样式 */
.theme-icon {
    margin-right: 5px;
}

/* 加载动画 */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .editor-view {
        grid-template-columns: 200px 1fr 200px;
    }
}

@media (max-width: 992px) {
    .editor-view {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        gap: 15px;
    }
    
    .templates-sidebar, .parameters-sidebar {
        max-height: 200px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-top {
        position: static;
    }
    
    .header-controls {
        position: static;
        flex-direction: column;
        margin-top: 15px;
        width: 100%;
    }
    
    .view-tabs {
        flex-direction: column;
    }
    
    .editor-header {
        position: relative;
        justify-content: flex-end;
        padding: 10px 0;
    }
}

/* 开屏动画样式 */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.splash-logo {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

.splash-logo i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #2496ed;
}

.splash-logo h2 {
    margin-bottom: 2rem;
    font-weight: 300;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #2496ed;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.splash-left, .splash-right {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.splash-left {
    left: 0;
    transform: translateX(0);
}

.splash-right {
    right: 0;
    transform: translateX(0);
}

/* 开屏动画结束状态 */
.splash-screen-hidden .splash-left {
    transform: translateX(-100%);
}

.splash-screen-hidden .splash-right {
    transform: translateX(100%);
}

.splash-screen-hidden .splash-logo {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}